package com.demo.cms.action.demo;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.demo.core.dao.ConfigDao;
import com.demo.core.dao.base.support.SearchResultSupport;
import com.demo.core.model.Config;
import com.demo.webapp.action.PageAction;
import com.opensymphony.xwork2.interceptor.annotations.InputConfig;

public class TestAction extends PageAction {

	private static final Log log = LogFactory.getLog(TestAction.class);
	/**
	 * 
	 */
	private static final long serialVersionUID = 1828668869364180296L;
	
	private ConfigDao configDao;
	
	private Config config;
	
	
    public String execute() throws Exception {
    	log.debug("method : execute");
        return SUCCESS;
    }
    public String input() throws Exception {
    	log.debug("method : input");
        return INPUT;
    }
    
    //验证错误,跳转结果页面
    @InputConfig(resultName="success")
	public String list() {
		
		//设置检索的参数
		Map<String, Object> params = new HashMap<String, Object>();
		//将分页参数并入
		SearchResultSupport<Config> configResult = configDao.search(params, super.getArgumentSupport());
		//设置检索结果
		super.setResultSupport(configResult);
		
		log.debug("method : list");
		return SUCCESS;
	}
	
	public String getModel() {
		return "T-M";
	}
	public void setConfigDao(ConfigDao configDao) {
		this.configDao = configDao;
	}
	
	public void setConfig(Config config) {
		this.config = config;
	}
	public Config getConfig() {
		return config;
	}

}
